package com.fuint.module.clientApi.controller;

import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import com.fuint.utils.aliyun.LogisticsData;
import com.fuint.utils.aliyun.LogisticsUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Api(tags = "会员端-物流相关接口")
@RestController
@RequestMapping(value = "/clientApi/logistics")
public class ClientLogisticsController extends BaseController {
    private final LogisticsUtil logisticsUtil;

    @Autowired
    ClientLogisticsController(LogisticsUtil logisticsUtil) {
        this.logisticsUtil = logisticsUtil;
    }

    @ApiOperation(value = "获取物流信息列表", notes = "获取物流信息列表")
    @GetMapping(value = "list")
    @CrossOrigin
    public ResponseObject list(@RequestParam String expressNo, @RequestParam String mobile) {
        LogisticsData logisticsResponse = logisticsUtil.doPost(expressNo, mobile);
        return getSuccessResult(logisticsResponse);
    }
}